<!--  -->
<template>
  <div>

    <h1>这是一个子组件<span>{{value}}</span></h1>
    <button @click="jiayiFn">点击加1</button>
  </div>
</template>

<script>
export default {
  data () {
    return {
    }
  },
  props: {
    value: {
      type: Number,
      default: 0
    }
  },
  methods: {
    jiayiFn () {
      this.$emit('input', this.value + 1)
    }
  }
}

</script>
<style lang='less' scoped>
</style>
